package avicit.bdp.dcs.precheck.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @金航数码科技有限责任公司
 * @作者：liyb
 * @邮箱：liyb@avic-digital.com
 * @创建时间：2020-08-05 14:13
 * @类说明：预检查配置实体类
 * @修改记录：
 */
@ApiModel(value = "PrecheckItemDTO", description = "bdp_dcs_precheck_item")
@Table(name = "bdp_dcs_precheck_item")
public class PrecheckItemDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    // 主键
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    // 检测项
    @LogField
    @ApiModelProperty(value = "检测项")
    @FieldRemark(column = "check_item", field = "checkItem", name = "检测项")
    @Column(name = "check_item")
    private String checkItem;

    // 检测项编码，源库连接性检查：1，目的库连接性检查：2，源库权限检查：3：，目的库权限检查：4，同名表存在性检查：5
    @LogField
    @ApiModelProperty(value = "检测项编码，源库连接性检查：1，目的库连接性检查：2，源库权限检查：3：，目的库权限检查：4，同名表存在性检查：5")
    @FieldRemark(column = "check_item_code", field = "checkItemCode", name = "检测项编码")
    @Column(name = "check_item_code")
    private Integer checkItemCode;

    // 检测内容
    @LogField
    @ApiModelProperty(value = "检测内容")
    @FieldRemark(column = "check_content", field = "checkContent", name = "检测内容")
    @Column(name = "check_content")
    private String checkContent;

    // 失败原因
    @LogField
    @ApiModelProperty(value = "失败原因")
    @FieldRemark(column = "failure_reason", field = "failureReason", name = "失败原因")
    @Column(name = "failure_reason")
    private String failureReason;

    // 解决方案
    @LogField
    @ApiModelProperty(value = "解决方案")
    @FieldRemark(column = "solution", field = "solution", name = "解决方案")
    @Column(name = "solution")
    private String solution;

    // 组织机构代码
    @ApiModelProperty(value = "组织机构代码")
    @FieldRemark(column = "org_identity", field = "orgIdentity", name = "组织机构代码")
    @Column(name = "org_identity")
    private String orgIdentity;

    // 密级
    @ApiModelProperty(value = "密级")
    @FieldRemark(column = "secret_level", field = "secretLevel", name = "密级")
    @Column(name = "secret_level")
    private String secretLevel;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCheckItem() {
        return checkItem;
    }

    public void setCheckItem(String checkItem) {
        this.checkItem = checkItem;
    }

    public Integer getCheckItemCode() {
        return checkItemCode;
    }

    public void setCheckItemCode(Integer checkItemCode) {
        this.checkItemCode = checkItemCode;
    }

    public String getCheckContent() {
        return checkContent;
    }

    public void setCheckContent(String checkContent) {
        this.checkContent = checkContent;
    }

    public String getFailureReason() {
        return failureReason;
    }

    public void setFailureReason(String failureReason) {
        this.failureReason = failureReason;
    }

    public String getSolution() {
        return solution;
    }

    public void setSolution(String solution) {
        this.solution = solution;
    }

    @Override
    public String getOrgIdentity() {
        return orgIdentity;
    }

    @Override
    public void setOrgIdentity(String orgIdentity) {
        this.orgIdentity = orgIdentity;
    }

    @Override
    public String getSecretLevel() {
        return secretLevel;
    }

    @Override
    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "预检查项管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "预检查项";
        } else {
            return super.logTitle;
        }
    }

}